import { defineStore } from 'pinia'

export const useUserStore = defineStore({
  id: 'user', // id必填，且需要唯一
  state: () => {
    return {
      firsrname: '张',
      lastname: '三',
      age: 17,
    }
  },
  getters: {
    getFullNam(): string {
      return `${this.firsrname}-${this.lastname}`
    },
  },
  actions: {
    updateName(name: string) {
      this.lastname = name
    },
  },
})
